package com.day1011;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class DeserializeDemo {
    public static void main(String[] args) {
        //反序列化-user
        try {
            //打开序列化文件
            FileInputStream fis=new FileInputStream("D:/code/man");
            //反序列化
            ObjectInputStream ois = new ObjectInputStream(fis);
            //读取文件
            User user=(User)ois.readObject();
            System.out.println(user);

            fis.close();
            ois.close();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
